package com.oocl.myProject;

public class DoublyLinkList {  
	private MyNode head = new MyNode(null, -1, null);
	
	public MyNode getHead() {
		return head;
	}
	public void setHead(MyNode head) {
		this.head = head;
	}
	public DoublyLinkList(int[] nums) {
		MyNode p = head;
		MyNode s = new MyNode(head, nums[0], null);
		head.next = s;
		p = p.next;
		for (int i = 1; i < nums.length; i++) {
			MyNode r = new MyNode(p, nums[i], null);
		p.next = r;
		p = p.next;
		}
	}
	public static void main(String[] args) {
		int num[]={1,2,3,4,5};
		DoublyLinkList ll = new DoublyLinkList(num);
		System.out.println(ll.getHead().data);

	}

}
